﻿using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using Clojure;

public class TriggerTimer 
{
  public  DateTime StartTime;
  public float DurationTime;

  public TriggerTimer(float durationTime) 
  {
      this.DurationTime = durationTime;
      this.StartTime = DateTime.Now;
  }
  
}

public class TriggerVars 
{
    public static void DefineVarActions(Context context) 
    {
        context.Define("def-timer",new FunctionNode(_def_timer));
    }

    public static ASTNode _def_timer(List<ASTNode> args,Context context) 
    {
        args = CoreFunction.EvalArgs(args,context);
        float durationTime = (float)((NumberNode)args[0]).NumberVal;
        return new ObjectNode(new TriggerTimer(durationTime));
    }

}